package com.spring.controll;


import com.alibaba.fastjson.*;
import net.jntoo.db.Query;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import util.*;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * 首页控制器
 */
@Controller
public class IndexController extends BaseController {

    // 首页
    @RequestMapping(value = {"/", "index"})
    public String Index() {

        ArrayList<HashMap> bhtList = Query.make("lunbotu").order("id desc").limit(3).select();
        assign("bhtList", bhtList);


        ArrayList<HashMap> shujilist1 = Query.make("shuji").limit(4).order("id desc").select();
        assign("shujilist1", shujilist1);


        ArrayList<HashMap> shujilist2 = Query.make("shuji").limit(4).order("jieyuecishu desc").select();
        assign("shujilist2", shujilist2);
        if (isAjax()) {
            return json();
        }
        return "index";

    }


}
